package com.kly.user.controller.chatter;

import com.kly.user.chatterService.ChatterUserServiceImpl;
import com.kly.user.dto.UserInfoDto;
import com.kly.user.dto.chatter.ChatterLogin;
import com.kly.user.dto.chatter.request.AlbumsRequestDto;
import com.kly.user.dto.chatter.response.AlbumsResponseDto;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("chatter/user")
public class ChatterUserController {
    @Resource
    ChatterUserServiceImpl chatterUserService;

    @ResponseBody
    @RequestMapping(value = "/authLogin")
    public UserInfoDto authLogin(@RequestBody ChatterLogin chatterLogin) {
        return chatterUserService.login(chatterLogin.getAccount(), chatterLogin.getAccountPassword());
    }

    @ResponseBody
    @RequestMapping(value = "/getImage")
    public List<AlbumsResponseDto> getImage(@RequestBody AlbumsRequestDto albumsRequest) {
        return chatterUserService.getImageUrl(albumsRequest.getUserCode(), albumsRequest.getAlbumType());
    }

    @ResponseBody
    @RequestMapping(value = "/getUserGPS")
    public List<AlbumsResponseDto> getUserGPS(@RequestBody AlbumsRequestDto albumsRequest) {
        return null;
    }
}
